home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
comm
/
prtcs155.zip
/
NOTE.WPL
< prev
next >
Wrap
Text File
|
1994-01-14
|
7KB
|
255 lines
/**/
v="$VER: NOTE Wplrx Roof Remote Feedback to Sysop Utility Williamson 54.09"
/* Non-Secure Inbound directory for users */
indir=addslash(dequote(getclip('INDIR')))||'USERS/'
/* TAGNAME of your SYSOP Feedback message base */
sysopbase=GetClip('SYSOPBASE')
/* Your name */
sysop=GetClip('SYSOP')
/* path to rexx scripts */
rpath=addslash(dequote(GetClip('REXXDIR')))
options RESULTS
options failat 99
signal on syntax
signal on halt
signal on ioerr
signal on break_c
signal on break_d
if ~show('L', "rexxsupport.library") then
if ~addlib("rexxsupport.library", 0, -30, 0) then do
say "Couldn't access support.library !"
exit 20
end
pragma("W","NULL")
log=show('P','ROOFLOG')
mailer=GetCLip('SHELTER')
l_mailer=lower(mailer)
sv = 'v'||right(v,5)
script = "NOTE"
cr = '\r\n' /* WPL */
nl = '0a'X /* REXX */
bs = '08'x
quote = '"'
msgbuf=" NOTE Feedback Posted:"date()" at "time()||nl
tmsg="T:NOTE-"pragma('ID')
parse arg baud port username
call send(cr||cr||' NOTE FeedBack to Sysop 'sv' on $(host.sitename) Line 'port||cr||cr)
if username="" then fname=strip(wpl_prompt(240,cr||' Please enter your name: '))
else fname=strip(username)
if fname="" then do
call send(cr||'Sorry, your name is required for Feedback to system operator'||cr)
call cleanup()
exit 0
end
call logusername(fname)
call PutLog('Feedback from 'fname,10,10)
'CheckCarrier'
if RC~=0 then do
call PutLog('User' fname 'dropped carrier',10,10)
call cleanup
exit
end
resp=wpl_prompt(240,'Subject? (RETURN aborts): ')
if resp="" then do
call send(cr||' Message aborted'||cr)
call cleanup()
exit
end
else subject=strip(resp)
resp=upper(wpl_prompt(120,' [Z]modem upload or [T]ext entry? '))
if resp="Z" then do
ul=1
call send(cr||' Upload your message with a filename formed as follows:'||cr)
call send(' Your_Name.NOTE, with underlines replacing any spaces in YourName.'||cr)
tmsg=indir||translate(fname,"_"," ")||".NOTE"
'Set protocol ZMODEM session "UPLOAD" inbound $(userdir) remote.sysop $(username) remote.sitename UNKNOWN'
'BeginSession $(remote.address)'
'RexxMsg NY "LOGPROC" "PutLog 'l_mailer'wpl $<time> $(line) $(session) from $(username) at $(remote.address)"'
'RexxMsg NY "LOGPROC" "PutLine 'l_mailer'wplstat$(line) $(p.session) $(session) $(p.protocol) $(protocol) $(p.inbound) USER $(p.rsysop) $(remote.sysop)"'
'SetMailerFlags "DN,PN"'
'XprSetup xprzedzap.library TN,OR,B8,F0,E30,AN,DN,KN,SN,RN,NY,M8192,C$(baud)'
'SetUpDate "RAW:0/$($(line).w_offset)/640/130/Line $(line) $(protocol) $(session) $(remote.domain) $(remote.zone) $(remote.net) $(remote.node) $(remote.point) $(remote.sysop) $(remote.sitename)/AUTO/INACTIVE/NOCLOSE/NOSIZE/SCREEN$(pscreen)"'
'XprReceive ""'
'XprClose'
'SetUpdate NULL'
'RexxMsg NY "LOGPROC" "PutLog 'l_mailer'wpl $<time> $(line) $(remote.address) $(protocol) RC:$(RC)"'
'ReplyCall 0'
'EndSession all'
'SetStatus "$(openstatus)"'
end
else do
ul=0
call send(cr||' Enter your message one line (of no more than 256 characters) at a time')
call send(cr||' Hit RETURN on a blank line to select Save or continue.'||cr)
call get_sysopmsg()
editing=1;line=1;c=0
do while editing
do while resp ~= ""
'CheckCarrier'
if RC~=0 then leave
resp=wpl_prompt(300,"->"line": ")
if resp ~= "" then do
msgbuf=msgbuf||resp||nl
line=line+1
end
end /* hit a blank line */
'CheckCarrier'
if RC~=0 then do
msgbuf=msgbuf||'User' fname 'dropped carrier during feedback'||nl
call save_msg
call cleanup
exit
end
resp=wpl_prompt(120,cr||' You entered 'line-1' lines, [S]ave/[c]ontinue?'||cr)
if upper(resp)="S" then editing=0
end /* finished editing */
msgbuf=msgbuf||nl
end
if save_msg() then do
if ul then subject="NOTE "||subject
call send(cr||' Saving......')
if exists("RPDIR:Smsg") then do
cmd=sysopbase tmsg '"'fname'"' '"'sysop'"' subject
address COMMAND "Smsg" cmd
end;else do
cmd=rpath'Smsg.rexx' sysopbase tmsg '"'fname'"' '"'sysop'"' subject
Address "AREXX" cmd
end
call send(cr||' Message saved, thanks' fname||cr)
end
call send(cr||cr||' Returning to command prompt'||cr||cr)
call PutLog('Posted NOTE feedback from 'fname,10,10)
call cleanup()
exit 0
logusername:
'String $(p.login)'
namepos=RESULT
'String $(p.session)'
sesspos=RESULT
Address "LOGPROC" "PutLine 'l_mailer'wplstat"||port sesspos script namepos arg(1) time()
return
get_sysopmsg:
sysopmsg="LOG:RFSacct/h/"||translate(fname,"_"," ")||".0.0.0.0.m"
PutLog('Searching for' sysopmsg,60,10)
if ~exists(sysopmsg) then return
else do
resp=wpl_prompt(240,cr||" Reply to sysop's last message? (y/N): ")
if upper(resp) ~= "Y" then do
call send(cr||" If you do not reply, message will be displayed every time you call."||cr)
return
end
end
if ~open('sysop',sysopmsg,'r') then do
call send(cr||"Error:unable to find sysop message"||cr)
return
end
msgbuf=' Dear Sysop, In your previous message to me, you said:'||nl
call send(cr||msgbuf||cr)
do while ~eof('sysop')
tmp=" Sysop> "||readln('sysop')
call send(tmp||cr)
msgbuf=msgbuf||tmp||nl
drop tmp
end
msgbuf=msgbuf||nl
call close('sysop')
call delete(sysopmsg)
return
save_msg:
if ul then do
putlog('msgul: 'tmsg,10,10)
return exists(tmsg)
end
if ~open('note',tmsg,"W") then do
call send(cr||'Unable to save message'||cr)
return 0
end
call writech('note',msgbuf)
call close('note')
return 1
send:
'Print' quote||arg(1)||quote
'Send' quote||arg(1)||quote
return
wpl_prompt:
'Print' quote||arg(2)||quote
nprompt:
'Send' quote||arg(2)||quote
getstring:
'GetInbound E0 'arg(1)
'String $(event)'
if upper(RESULT) = 'CARRIER' then do
ADdress "LOGPROC" 'PutLog 'l_mailer'wpl' time() line fname 'Dropped Carrier'
call cleanup
exit
end;else if upper(RESULT) = 'LOGIN' then do
'String $(namebuf)'
x=(RESULT)
end;else x=""
return x
lower:
return(bitor(arg(1),'20'x))
PutLog: procedure expose log script
if arg(2) > GetClip('LOGLEVEL') & ~log then return 0
address 'ROOFLOG' 'logline' left(time(),5) script': 'arg(1)
address
return 0
addslash:
curr = arg(1)
select
when right(curr, 1) = ":" then nop
when right(curr, 1) = "/" then nop
otherwise curr = curr"/"
end
return curr
/* a useful procedure by Walt Sullivan */
dequote:
parse arg thing
parse var thing '"' unq_thing '"'
if unq_thing ~= "" then return unq_thing
return thing
cleanup:
return 0
break_c:
break_d:
PutLog('User abort',10,10)
call cleanup
exit 10
novalue:
call template_oops "Novalue" sigl
syntax:
call template_oops "Syntax(RC=" || RC || ")" sigl
failure:
call template_oops "Failure(RC=" || RC || ")" sigl
ioerr:
call template_oops "IOErr" sigl
halt:
call template_oops "Halt" sigl
template_oops:
parse arg what badline
PutLog('Error Line:'badline what,10,10)
call cleanup
exit(40)
/**/